fix: Index.fts({ withPosition: true }) to enable phrase queries#404
Open
jlin53882 wants to merge 1 commit intoCortexReach:masterfrom
Open
fix: Index.fts({ withPosition: true }) to enable phrase queries#404jlin53882 wants to merge 1 commit intoCortexReach:masterfrom
jlin53882 wants to merge 1 commit intoCortexReach:masterfrom
Conversation
Fix BM25 search failure: position is not found but required for phrase queries
Root cause: Index.fts() accepts an options object, not a boolean.
Index.fts(true) sets options=true, so options?.withPosition is undefined.
Fix: use Index.fts({ withPosition: true }) instead.
Fixes: CortexReach#402
Contributor
Author
CI 分析:此 PR 的 FTS 修正與 CI 失敗無關CI 失敗的真正原因本次 CI 失敗的是 這是 upstream 觸發原因測試 config 為 Upstream master 最近有兩個 commit 造成 regression:
當 selfImprovement.enabled 預設為 true 時, upstream master 的 CI 狀態master 分支本身的 CI 也處於 failed 狀態(最近兩次 push 都是 failed),確認這是既有問題,不是本 PR 引入的。 本 PR 的變更確認
建議等待 upstream maintainer 修復 master 的 selfImprovement regression 後,本 PR 即可合併。 |
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a critical bug where phrase queries (e.g.,
"hello world") fail with:position is not found but required for phrase queriesRoot Cause
In
src/store.ts,createFtsIndex()was callingIndex.fts()without arguments:@lancedb/lancedbIndex.fts()accepts an options object, not positional boolean:When called as
Index.fts(true)(boolean),options?.withPositionisundefined→ phrase queries fail.Fix
Verification
Tested in isolated environment (
test-pr354) — 30 iterations, 150 test cases:Index.fts()without args: phrase query FAILSIndex.fts({ withPosition: true }): phrase query PASSES 100%Related Issue
Fixes #402